<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="cn.zqy.services.*" %>
<%@ page import="cn.zqy.model.BookLanguage" %>
<%@ page import="cn.zqy.model.BookStatus" %>
<%@ page import="cn.zqy.model.LibraryActions" %>
<%@ page import="com.google.appengine.api.users.User"%>
<%@ page import="com.google.appengine.api.users.UserService"%>
<%@ page import="com.google.appengine.api.users.UserServiceFactory"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Book[Administrator]</title>
<link rel="stylesheet" type="text/css" href=""/>
<script type="text/javascript">
function init()
{
	/*通过 javascript获得当前窗口页面的宽高度
	网页可见区域宽： document.body.clientWidth; 
	网页可见区域高： document.body.clientHeight; 
	网页可见区域高： document.body.offsetWidth;  //包括边线的宽
	网页可见区域高： document.body.offsetHeight; //包括边线的宽
	网页正文全文宽： document.body.scrollWidth; 
	网页正文全文高： document.body.scrollHeight; 
	网页被卷去的高： document.body.scrollTop;
	网页被卷去的左： document.body.scrollLeft;
	网页正文部分上： window.screenTop; 
	网页正文部分左： window.screenLeft; 
	屏幕分辨率的高： window.screen.height;
	屏幕分辨率的宽： window.screen.width;
	屏幕可用工作区高度： window.screen.availHeight; 
	屏幕可用工作区宽度： window.screen.availWidth;
	*/
	/*
	var frameHeight=screen.availHeight*0.7;
	var frameObj=document.getElementById("ifrm");
	if(frameObj!=null)
	{
		frameObj.height=frameHeight;
	}*/
	//document.getElementById("ifrm").height=screen.availHeight*0.7;
}
</script>
</head>
<body onload="init();">
<%
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
if(Utils.isAuthorized())
{
//	String bookStatusSelect=Utils.createHtmlSelect("book_status",BookStatus.ALL.getAllDesc(),BookStatus.ALL.getAllValue(),BookStatus.IN.getValue());
//	String bookLanguageSelect=Utils.createHtmlSelect("book_language",BookLanguage.ALL.getAllDesc(),BookLanguage.ALL.getAllValue(),"");
	response.sendRedirect("/library.jsp");
%>
<!-- 
<form action="/Library" method="post">
  <table align="center">
	<tr>
		<td>No.</td><td><input name="book_no" /></td>
		<td>Name</td><td><input name="book_name" /></td>
		<td>Language</td><td><%//=bookLanguageSelect %></td>	
		<td>Status</td><td><%//=bookStatusSelect %></td>
		<td>Owner</td><td><input name="book_owner" /></td>
		<td><input type="submit" value="Add"/><input type="hidden" name="flag" value="<%//=LibraryActions.ADD.toString() %>" /></td>
	</tr>
  </table>
</form>
<iframe id="ifrm" src="library.jsp" width="100%" frameborder="1" marginwidth="3px" marginheight="10px" ></iframe>
 -->
<%
}
else
{
	out.println("<p>请<a	 href="+userService.createLoginURL(request.getRequestURI())+">登陆</a></p>");
}
%>
</body>
</html>